import * as type from '../mutation-type'

const initState = {
  // 详情
  report: {
    created_at: null,
    id: null,
    display_id: null,
    user_id: null,
    category: null,
    phone: null,
    name: null,
    gender: null,
    scan_picture: null,
    optometrist_name: null,
    measured_at: null,
    reviewed_at: null,
    reviewer_name: null,
    inputed_at: null,
    inputer_name: null,
    content: {},
  },
  // 列表
  reports: [],
}

const state = _.cloneDeep(initState)

const mutations = {
  // 列表
  [type.GET_REPORTS] (state, value, concat) {
    state.reports = value
  },

  // 详情
  [type.GET_REPORT] (state, value) {
    state.report = value
  },

}

export default {
  state,
  mutations
}
